[IA64] Prevent domains to itc/ptd in shared_info_va.
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 3 Oct 2006 03:30:51 +0000 (21:30 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 3 Oct 2006 03:30:51 +0000 (21:30 -0600)
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
xen/arch/ia64/xen/vcpu.c
xen/include/public/arch-ia64.h

index cab06b25769f4afe923077526ea361be31f16452..fdf7b6c8a5c223ce845ac744acae625e8cabf5e0 100644 (file)
@@ -1314,12 +1314,21 @@ static inline int range_overlap (u64 b1, u64 e1, u64 b2, u64 e2)
 static inline void
 check_xen_space_overlap (const char *func, u64 base, u64 page_size)
 {
+       /* Overlaps can occur only in region 7.
+          (This is an optimization to bypass all the checks).  */
+       if (REGION_NUMBER(base) != 7)
+               return;
+
        /* Mask LSBs of base.  */
        base &= ~(page_size - 1);
 
        /* FIXME: ideally an MCA should be generated...  */
        if (range_overlap (HYPERVISOR_VIRT_START, HYPERVISOR_VIRT_END,
-                          base, base + page_size))
+                          base, base + page_size)
+           || range_overlap(current->domain->arch.shared_info_va,
+                            current->domain->arch.shared_info_va 
+                            + XSI_SIZE + XMAPPEDREGS_SIZE,
+                            base, base + page_size))
                panic_domain (NULL, "%s on Xen virtual space (%lx)\n",
                              func, base);
 }
index aa51d3297d5cbb61ce4280c1da1d3354d990622e..62fbaf6dae23d6f398c1be0cb3fa246a293e2f17 100644 (file)
@@ -397,6 +397,7 @@ struct xen_ia64_boot_param {
 #define XSI_SIZE                       (1 << XSI_SHIFT)
 /* Log size of mapped_regs area (64 KB - only 4KB is used).  */
 #define XMAPPEDREGS_SHIFT              12
+#define XMAPPEDREGS_SIZE               (1 << XMAPPEDREGS_SHIFT)
 /* Offset of XASI (Xen arch shared info) wrt XSI_BASE.  */
 #define XMAPPEDREGS_OFS                        XSI_SIZE